<div class="alert {{if this.hasError "alert-danger" "hide"}}">
    {{this.errors}}
</div>

<div class="container-fluid">
    <form class="form-horizontal" role="form">
        {{#each this.visibleFields as |field|}}
            <OxiSection::Form::Field
                @field={{field}}
                @addClone={{this.addClone}}
                @delClone={{this.delClone}}
                @setValue={{fn this.setFieldValue field}}
                @setName={{fn this.setFieldName field}}
                @setError={{fn this.setFieldError field}}
                @submit={{this.submit}}
                @setFocusInfo={{fn this.setFocusInfo field}}
            />
        {{/each}}
        <div class="form-group">
            <div class="col-md-offset-2 col-sm-7 oxi-form-button">
                <BsButton @type="default" class="{{if this.loading "oxi-btn-loading"}} oxi-btn-submit" @onClick={{this.submit}}>
                    {{try @def.submit_label (t 'component.oxisection_form.submit')}}
                </BsButton>
                {{#if @def.reset}}
                    <BsButton @type="default" class="oxi-btn-reset" @onClick={{this.reset}}>
                        {{try @def.reset_label (t 'component.oxisection_form.reset')}}
                    </BsButton>
                {{/if}}
                <div class="spacer"></div>
                <OxiBase::ButtonContainer @buttons={{@def.buttons}} @buttonClick={{@buttonClick}}/>
            </div>
        </div>
    </form>
</div>
